class Solution {
    public:
        int row[9][10] = {0};
        int col[9][10] = {0};
        int mbord[3][3][10] = {0};
        bool isValidSudoku(vector<vector<char>>& board) {
            for(int i = 0 ; i < 9 ; i++){
                for(int j = 0 ; j < 9 ; j++){
                    if(board[i][j] != '.'){
                        int num = board[i][j] - '0';
                        if(row[i][num] == 0 && col[j][num] == 0 && mbord[i/3][j/3][num] == 0){
                            row[i][num] = 1;
                            col[j][num] = 1;
                            mbord[i/3][j/3][num] =1;
                        }else{
                            return false;
                        }
                    }
                }
            }
            return true;
        }
    };